package tw.com.softleader.reins.demo.exam.app;
import java.util.List;

import tw.com.softleader.reins.demo.exam.entity.Exam;
import tw.com.softleader.reins.demo.exam.service.ExamService;

public class ExamApp {
	public static void main(String[] args) {
		
		//TestService.generateTests();
		
		ExamService examService=new ExamService();
		
		List<Exam> exams=examService.getAll();
		System.out.println("id\tName\tDif\titem\tTime(mins)");
		for(Exam exam:exams){
			System.out.print(exam.getId()+"\t"+
					 exam.getName()+"\t"+
					 exam.getDifficulty()+"\t"+
					 exam.getItemLength()+"\t"+
					 exam.getTime()+"\n");
		}
		System.out.println("------------------");
		
		Exam idTest=examService.getById(2L);
		System.out.println("id\tName\tDif\titem\tTime(mins)");
		System.out.print(idTest.getId()+"\t"+
						 idTest.getName()+"\t"+
						 idTest.getDifficulty()+"\t"+
						 idTest.getItemLength()+"\t"+
						 idTest.getTime()+"\n");
		
		//testService.insertData(100);

	}

}
